package unittest;

import junit.framework.TestCase;
import tester.anticheeting.Matcher;

/**
 * Created by IntelliJ IDEA.
 * User: aleck
 * Date: 2007-10-26
 * Time: 21:02:32
 * To change this template use File | Settings | File Templates.
 */
public class MatcherTest extends TestCase {
  private int runSimilarity(String a, String b) {
    int sim = Matcher.similarity(a, b);
    System.out.println(sim);
    return sim;
  }

  public void test1() {
    assertEquals(runSimilarity("abc", "abc"), 100);
    assertEquals(runSimilarity("abc", "abe"), 67);
    assertEquals(runSimilarity("ab", "a"), 67);
    assertEquals(runSimilarity("abcd", "bcde"), 75);
  }

  public void test2() {
    assertEquals(runSimilarity("asasa", "bsbsb"), 80);
    assertEquals(runSimilarity("asasa", "csbsb"), 60);
    runSimilarity(
        "aabbccddeeffgg",
        "aabbddcceeffgg");
  }
}
